<?php


namespace dsp\snapshot;


class Main extends \kernel\BaseMain
{

    public function execute($choice = 'all')
    {
        $originator = new Originator("Super-duper-super-puper-super.");
        $caretaker = new Caretaker($originator);

        $caretaker->backup();
        $originator->doSomething();

        $caretaker->backup();
        $originator->doSomething();

        $caretaker->backup();
        $originator->doSomething();

        echo PHP_EOL;
        $caretaker->showHistory();

        echo PHP_EOL . "Client: Now, let's rollback!" . PHP_EOL;
        $caretaker->undo();

        echo PHP_EOL . "Client: Once more!" . PHP_EOLPHP_EOL;
        $caretaker->undo();
        echo PHP_EOL;
    }
}